using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Idle : StateBase<PlayerController>
{
    public Idle(PlayerController owner) : base(owner)
    {
    }

    public override void OnEnter()
    {
        m_Owner.Animator.SetTrigger(m_Owner.AnimatorParameter_Idle);
        m_Owner.OnJumpButtonDown += OnJumpListener;
    }
    public override void OnExit()
    {
        m_Owner.OnJumpButtonDown -= OnJumpListener;
    }

    private void OnJumpListener()
    {
        m_Owner.Jump();
    }

    public override void Update()
    {
        if (m_Owner.MoveFactor != 0)
        {
            m_Owner.ChangeState(m_Owner.MoveState);
        }
    }
    public override void FixedUpdate()
    {
        m_Owner.Idle();
    }
}
